{extend name="index@common/base"/} 
{block name="style"}
<link rel="stylesheet" href="__CSS__/admin/config.css">
{/block} 
{block name="body"}
<div class="layui-body layui-tab-content index-body" id="cont">
	<div class="park-navigation">
		<div class="navigation-icon">
			<i class="fa {$breadCrumb[0]['icon']}"></i>
		</div>
		<div class="navigation-menu">
			<h2>{$breadCrumb[0]['title']}</h2>
			{if isset($breadCrumb[1])}
			<p>{$breadCrumb[0]['remark']}</p>
			{/if}
		</div>
		<div class="navigation-page">
			<ul>
				<li class="this" data-type="photo">导航图</li>
				{volist name="groups" id="item"}
				<li data-type="{$item}">{$item}</li>
				{/volist}
			</ul>
		</div>
	</div>
	<div class="park-content" id="page-photo">
		<div class="content-title">
			<div class="title col-8">
				<h3>{$breadCrumb[1]['title']}</h3>
			</div>
			<div class="tool col-2">
				<button class="add"  data-url="{:url('admin/config/addPhoto')}"><i class="fa fa-plus"></i></button>
				<button class="reload" data-type="photo"><i class="fa fa-refresh"></i></button>
			</div>
		</div>
		<div class="layui-content"  id="photo_view" data-url="{:url('admin/config/aerialphoto')}" data-template="#photoTemplate">               
	   	</div>
	</div>
	{volist name="groups" id="item"}
	<div class="park-content page-hide" id="page-{$item}">
		<div class="content-title">
			<div class="title col-7">
				<h3>{$breadCrumb[1]['title']}</h3>
			</div>
			<div class="tool col-3">
				<button class="add"  data-url="{:url('admin/config/add')}"><i class="fa fa-plus"></i></button>	
				<button class="reload" data-type="{$item}"><i class="fa fa-refresh"></i></button>
				<button class="clear" data-url="{:url('admin/config/clear')}"><i class="fa fa-trash"></i></button>
			</div>
		</div>
		<div class="layui-content" id="{$item}_view" data-url="{:url('admin/config/configList',array('group'=>$item))}" data-template="#configTemplate">               
	   	</div>
	</div>
	{/volist}
</div>
<script type="text/html" id="photoTemplate">
	<div class="layui-row photo-list">
	{{# for(var i = 0;i < d.length; i++){ }}
    	<div class="layui-col-md3" >
      		<div class="photo-frame">
				<img src="__ROOT__/{{d[i].aerialphoto_url}}" data-url="{:url('admin/config/editPhoto')}" data-id="{{d[i].id}}"></img>
			</div>
			<span class="layui-layer-setwin">
					<a class="layui-layer-ico layui-layer-close layui-layer-close2" href="#" data-url="{:url('admin/config/delPhoto')}" data-id="{{d[i].id}}"></a>
			</span>
			<div class="photo-title">{{d[i].aerialphoto_title}}</div>
    	</div>
	{{# } }}
	</div>
</script>
<script type="text/html" id="configTemplate">
	  
		<div class="maintab config-table">
        <table> 
			<colgroup>
                 <col width="15%">
                 <col width="50%">
				 <col width="15%">
            </colgroup>
			<tbody>
				 {{# for(var i = 0;i < d.length; i++){ }}
  					<tr style="height:60px;">
                 		<th class="collapse">{{d[i].title}}</th>
                 		<th>
							<form action="{:url('admin/config/edit')}?id={{d[i].id}}" method="post" id="config_{{d[i].id}}">
								<div class="layui-input-block">
       								<input class="layui-input" name="value" data-set="value" type="text" value="{{d[i].value}}" />
									<input type="hidden" name="id" value="{{d[i].id}}"/>
            				 	</div>
							</form>
						</th>
						<th>{{d[i].name}}</th>
						<th style="text-align:center;">
							<a class="layui-btn btn-edit edit-config" data-id="{{d[i].id}}"><i class="fa fa-send"></i></a>
							<a class="layui-btn btn-del del-config" data-url="{:url('admin/config/del')}" data-id="{{d[i].id}}"><i class="fa fa-trash"></i></a>
						</th>
            		</tr>
				{{# } }}
			</tbody>
        </table>
		</div>
</script>
{/block}
{block name="script"}
<script type="text/javascript" src="__JS__/admin/config.js"></script>
{/block}
